<%@include file="../View/header.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns:th="http://www.thymeleaf.org" lang="">
<!-- 最新 Bootstrap4 核心 CSS 文件 -->
<link rel="stylesheet" th:href="@{//cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css}">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script th:src="@{//cdn.staticfile.org/jquery/3.4.1/jquery.min.js}"></script>
<!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
<script th:src="@{//cdn.staticfile.org/popper.js/1.16.0/umd/popper.min.js}"></script>
<!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
<script th:src="@{//cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js}"></script>
<!-- DaterangePicker -->
<link rel="stylesheet" type="text/css" media="all" th:href="@{/daterangepicker/daterangepicker.css}" />
<!-- BootStrapValidator -->
<link rel="stylesheet" th:href="@{/css/bootstrapValidator.css}">
<script type="text/javascript" th:src="@{/js/bootstrapValidator.js}"></script>
<script th:src="@{/js/functions.js}"></script>
<script type="text/javascript" th:src="@{/js/validate.js}"></script>
<style>
    input[type=text] {
        width: 100%;
        box-sizing: border-box;
        border: 2px solid #ccc;
        border-radius: 4px;
        font-size: 16px;
        background-color: white;
        background-position: 10px 10px;
        background-repeat: no-repeat;
        padding: 12px 20px 12px 40px;
    }
</style>
<div style="margin-left:25%;padding:1px 16px;height:1000px;">
    <form action="${pageContext.request.contextPath}/order/getOrders">
        <input type="text" name="orderId" placeholder="Search..">
        <input type="submit">
    </form>
    <div id="page-wrapper">
        <table class="table table-striped" border="2px">
            <thead>
            <tr>
                <th>订单编号</th>
                <th>用户编号</th>
                <th>航班编号</th>
                <th>价格</th>
                <th>舱位种类</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <div>
            </div>
            <c:forEach items="${orderList}" var="o" varStatus="num">
                <tr>
                    <td>${o.orderId }</td>
                    <td>${o.userId}</td>
                    <td>${o.flightId}</td>
                    <td>${o.price}</td>
                    <td>${o.berth}</td>
                    <td>
                        <a href="${pageContext.request.contextPath}/order/updateOrder?orderId=${o.orderId}">修改订单</a>
                        <a href="${pageContext.request.contextPath}/order/deleteOrder?orderId=${o.orderId}" onclick="return confirm('确认删除吗？')">删除</a>
                        <a href="${pageContext.request.contextPath}/order/updateBerth">修改舱位</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>